﻿@functions {
	private bool? ModelValue
	{
		get
		{
			if (ViewData.Model != null)
			{
				return null;
			}

			return Convert.ToBoolean(ViewData.Model, CultureInfo.InvariantCulture);
		}
	}
}

@if (ViewData.ModelMetadata.IsNullableValueType)
{
	<select class="list-box tri-state" disabled="disabled">
		<option value="" @(ModelValue.HasValue) ? "" : "selected='selected'">Not Set</option>
		<option value="true" @(ModelValue.HasValue && ModelValue.Value) ? "selected='selected'" : "">True</option>
		<option value="false" @(ModelValue.HasValue && !ModelValue.Value) ? "selected='selected'" : "">False</option>
	</select>
}
else
{
	<input class="check-box" disabled="disabled" type="checkbox" @(ModelValue.GetValueOrDefault()) ? "checked='checked'" : "" />
}